					
package com.module.device.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import base.util.Page;

import com.module.device.manager.DeviceEntityManager;
import com.module.device.vo.DeviceEntity;

public class DeviceEntityService {

	public Page list(DeviceEntity bean, Integer start, Integer limit)
			throws Exception {
		Page page = new Page();
		page.setStart(start);
		page.setLimit(limit);
		//bean.setUserId(LoginSession.getUserid());
		DeviceEntityManager manager = DeviceEntityManager.getInstance();
		page = manager.list(page, bean);
		return page;
	}

	public Map<String,Object> remove(Long id)throws Exception{       
		Map<String,Object> map = new HashMap<String,Object>();
		DeviceEntityManager manager = DeviceEntityManager.getInstance();
		map = manager.delete(id);
		return map;
		
	}	


	public Map<String,Object> save(DeviceEntity bean)throws Exception{
		//bean.setOrgId(LoginSession.getOrgid());
		Map<String,Object> map = new HashMap<String,Object>();
		DeviceEntityManager manager = DeviceEntityManager.getInstance();
		map = manager.add(bean);
		return map;

	} 
	

	public DeviceEntity findById(Long id)throws Exception{
		DeviceEntity bean = new DeviceEntity();
		DeviceEntityManager manager = DeviceEntityManager.getInstance();
		bean = manager.findById(id);
		return bean;
	}

}
